package cn.bupt.sse309.ydl.activity;

import cn.bupt.sse309.ydl.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class SettingActivity extends Activity implements OnClickListener {

  private Button  backBtn,loginBtn;

  private TextView titleTv,amendPasswordTv;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
    this.setContentView(R.layout.activity_setting);
    this.getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.base_title_with_back);
    this.initView();
  }

  /**
   *
   */
  public void initView() {
    // TODO Auto-generated method stub
    this.titleTv = (TextView) this.findViewById(R.id.baseTitleId);
    this.backBtn=(Button) this.findViewById(R.id.baseBack);
    this.titleTv.setText(R.string.title_setting);
    this.loginBtn=(Button) this.findViewById(R.id.btn_login);
    this.amendPasswordTv=(TextView) this.findViewById(R.id.tv_amend_password);
    this.loginBtn.setOnClickListener(this);
    this.backBtn.setOnClickListener( this);

  }

  /* (non-Javadoc)
   * @see android.view.View.OnClickListener#onClick(android.view.View)
   */
  @Override
  public void onClick(View v) {
    // TODO Auto-generated method stub

    switch (v.getId()) {
    case R.id.baseBack:
      SettingActivity.this.finish();
      break;
case R.id.btn_login:
  Intent intent =new Intent(SettingActivity.this,LoginActivity.class);
  this.startActivity(intent);

      break;
case R.id.tv_amend_password:
  Intent intent2 =new Intent(SettingActivity.this,ResetPasswordActivity.class);
  this.startActivity(intent2);

  break;

    default:
      break;
    }

  }
}
